﻿//*** Guidance generated code ***//
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Web.Http.ValueProviders;

namespace $safeprojectname$.Binding
{
    public class ApiValueContainer : IValueContainer
    {
        protected readonly IValueProvider ValueProvider;
        public ApiValueContainer(IValueProvider valueProvider)
        {
            ValueProvider = valueProvider;
        }

        public bool ContainsPrefix(string prefix)
        {
            return ValueProvider.ContainsPrefix(prefix);
        }

        public IValueResult GetValue(string key)
        {
            var value = ValueProvider.GetValue(key);

            return value.IsNull()
                ? null
                : new ApiValueResult(value);
        }
    }
}